
import { useState } from "react";
import DatePicker from "react-datepicker";

import "react-datepicker/dist/react-datepicker.css";
export default function InputDate({value ,setTime }) {
  const [startDate, setStartDate] = useState(new Date(value));
    return (
      <DatePicker
      className="datePicker"
      selected={startDate}
       onChange={(date) =>{ 
        setStartDate(date);
        setTime(date)
      }}
      showTimeSelect
      timeFormat="HH:mm"
      timeIntervals={1}
      timeCaption="time"
      dateFormat="yyyy-MM-dd HH:mm"
    />
  );
};